<?php

class News_IndexController extends Cms_CustomControllerAction
{
public $db;

    public function init()
    {
        /* Initialize action controller here */
         $this->db = Zend_Registry::get('db');
    }

    public function indexAction()
    {
        
        $news = Model_News::GetNews($this->db);
       // echo'<pre>';print_r($news->fetchAll());echo'</pre>';
       $this->view->news = $news;
    }
    
    public function viewAction()
    {
     
        $id = $this->_getParam('newsAlias');
        $news = new Model_News($this->db);
        $news->load($id, 'alias');
        $this->view->news = $news;
          // echo'<pre>';print_r( $news);echo'</pre>';
        //$this->view->news =  $news->getNewsAlias($id);
        
    }
    
}
